using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using CS6238Project2;
using CS6238Project2.Banking.Commerce;
using CS6238Project2.Banking.Communication;
using CS6238Project2.Banking.Tools;
using System.IO;
using System.Xml;
using System.Xml.Serialization;

namespace CS6238Project2.GUI
{
    public partial class InventoryManagerWindow : Form
    {
        public InventoryManagerWindow()
        {
            InitializeComponent();
        }

        private void OnClose(Object mySender, EventArgs myArgs)
        {
            Good g;

            for (int i = 0; i < goodsBindingSource.List.Count; i++)
            {
                g = (Good) goodsBindingSource.List[i];
                if (g.Name == "")//if it's null, delete it.
                {
                    goodsBindingSource.List.RemoveAt(i);
                    i--;//account for the smaller list
                }
            }
            
        }

        public BindingSource GoodsBindingSource
        {
            get { return goodsBindingSource; }
        }
    }
}